<?php
    include_once("functions_bandwidth.php");
    include_once("functions_domains.php");
    include_once("datefunctions.php");
?>


<?php
if ($_GET['content'] == 1)
{
    //Bandbreedte
    echo '<div>';
    echo '<table>';
    echo '        <tr>';
    echo '            <td><b>Totaal volume (vandaag):</b></td>';
    echo '            <td align="right">';
                    //Berekening datum 1ste tot laatste
                    $Start = date("Y/m/d") . " 00:00:00";
                    $Einde = date("Y/m/d") . " 23:59:59";

                    func_bw_total_volume_periode($Start, $Einde);
    echo '           </td>';
    echo '        </tr>';
    echo '        <tr>';
    echo '            <td><b>Totaal volume (gisteren):</b></td>';
    echo '            <td align="right">';
                    //Berekening datum 1ste tot laatste
                    $Start = date("Y/m/d") . " 00:00:00";
                    $Start = DateAdd("d", -1, $Start);
                    $Start = date("Y/m/d", $Start) . ' 00:00:00' ;
                    $Einde = date("Y/m/d") . " 23:59:59";
                    $Einde = DateAdd("d", -1, $Einde);
                    $Einde = date("Y/m/d", $Einde) . ' 23:59:59' ;

                    func_bw_total_volume_periode($Start, $Einde);
    echo '           </td>';
    echo '        </tr>';
    echo '        <tr>';
    echo '            <td><b>Totaal volume (laatste 7 dagen):</b></td>';
    echo '            <td align="right">';
                    //Berekening datum laatste 7 dagen
                    $Einde = date("Y/m/d") . " 23:59:59";
                    $Start = date("Y/m/d") . " 00:00:00";
                    $Start = DateAdd("d", -6, $Start);
                    $Start = date("Y/m/d", $Start) . ' 00:00:00' ;

                    func_bw_total_volume_periode($Start, $Einde);
    echo '           </td>';
    echo '        </tr>';
    echo '        <tr>';
    echo '            <td><b>Totaal volume (deze maand):</b></td>';
    echo '            <td align="right">';
                    //Berekening datum 1ste tot laatste
                    $Start = date("Y/m/") . "1 00:00:00";
                    $Einde = date("Y/m/") . "1 00:00:00";
                    $Einde = DateAdd("m", 1, $Einde);
                    $Einde = date("Y/m/d", $Einde) . ' 23:59:59' ;
                    $Einde = DateAdd("d", -1, $Einde);
                    $Einde = date("Y/m/d", $Einde) . ' 23:59:59';

                    func_bw_total_volume_periode($Start, $Einde);

    echo '           </td>';
    echo '        </tr>';
    echo '        <tr>';
    echo '            <td><b>Totaal volume (vorige maand):</b></td>';
    echo '            <td align="right">';
                      //Berekening datum 1ste tot laatste vorige maand
                      $Start = date("Y/m/") . "1 00:00:00";
                      $Start = DateAdd("m", -1, $Start);
                      $Start = date("Y/m/d", $Start) . ' 00:00:00' ;
                      $Einde = date("Y/m/") . "1 00:00:00";
                      $Einde = DateAdd("d", -1, $Einde);
                      $Einde = date("Y/m/d", $Einde) . ' 23:59:59';

                      func_bw_total_volume_periode($Start, $Einde);
    echo '            </td>';
    echo '        </tr>';
    echo '        <tr>';
    echo '           <td><b>Totaal volume (globaal):</b></td>';
    echo '            <td align="right">';
                      func_bw_total_volume();
    echo '            </td>';
    echo '        </tr>';
    echo '</table></div>';
    echo '<br />';

    //vandaag
    echo '<div><b>Verbruik vandaag<b><br />';
    echo '<iframe frameborder="0" width="780" height="240" src="graph_bw_total_today.php"></iframe>';
    echo '</div>';

    //gisteren
    
    echo '<div><b>Verbruik gisteren<b><br />';
    echo '<iframe frameborder="0" width="780" height="240" src="graph_bw_total_yesterday.php"></iframe>';
    echo '</div>';

    //Laatste 7 dagen
    echo '<div><b>Verbruik laatste 7 dagen<b><br />';
    echo '<iframe frameborder="0" width="780" height="240" src="graph_bw_total_7days.php"></iframe>';
    echo '</div>';

    //Laatste maand
    echo '<div><b>Verbruik deze maand<b><br />';
    echo '<iframe frameborder="0" width="780" height="240" src="graph_bw_total_month.php"></iframe>';
    echo '</div>';

    //Vorige maand
    echo '<div><b>Verbruik vorige maand<b><br />';
    echo '<iframe frameborder="0" width="780" height="240" src="graph_bw_total_prev_month.php"></iframe>';
    echo '</div>';


    echo '<div style="width:100%;clear:both;">';
    echo '<br />&nbsp;';
    echo '</div>';
}
if ($_GET['content'] == 2)
{
    //Bandbreedte
    echo '<div>';
    echo '<table>';
    echo '        <tr>';
    echo '            <td><b>Totaal volume (vandaag):</b></td>';
    echo '            <td align="right">';
                    //Berekening datum 1ste tot laatste
                    $Start = date("Y/m/d") . " 00:00:00";
                    $Einde = date("Y/m/d") . " 23:59:59";

                    func_bw_total_volume_periode($Start, $Einde);
    echo '           </td>';
    echo '        </tr>';
    echo '        <tr>';
    echo '            <td><b>Totaal volume (gisteren):</b></td>';
    echo '            <td align="right">';
                    //Berekening datum 1ste tot laatste
                    $Start = date("Y/m/d") . " 00:00:00";
                    $Start = DateAdd("d", -1, $Start);
                    $Start = date("Y/m/d", $Start) . ' 00:00:00' ;
                    $Einde = date("Y/m/d") . " 23:59:59";
                    $Einde = DateAdd("d", -1, $Einde);
                    $Einde = date("Y/m/d", $Einde) . ' 23:59:59' ;

                    func_bw_total_volume_periode($Start, $Einde);
    echo '           </td>';
    echo '        </tr>';
    echo '        <tr>';
    echo '            <td><b>Totaal volume (laatste 7 dagen):</b></td>';
    echo '            <td align="right">';
                    //Berekening datum laatste 7 dagen
                    $Einde = date("Y/m/d") . " 23:59:59";
                    $Start = date("Y/m/d") . " 00:00:00";
                    $Start = DateAdd("d", -6, $Start);
                    $Start = date("Y/m/d", $Start) . ' 00:00:00' ;

                    func_bw_total_volume_periode($Start, $Einde);
    echo '           </td>';
    echo '        </tr>';
    echo '        <tr>';
    echo '            <td><b>Totaal volume (deze maand):</b></td>';
    echo '            <td align="right">';
                    //Berekening datum 1ste tot laatste
                    $Start = date("Y/m/") . "1 00:00:00";
                    $Einde = date("Y/m/") . "1 00:00:00";
                    $Einde = DateAdd("m", 1, $Einde);
                    $Einde = date("Y/m/d", $Einde) . ' 23:59:59' ;
                    $Einde = DateAdd("d", -1, $Einde);
                    $Einde = date("Y/m/d", $Einde) . ' 23:59:59';

                    func_bw_total_volume_periode($Start, $Einde);

    echo '           </td>';
    echo '        </tr>';
    echo '        <tr>';
    echo '            <td><b>Totaal volume (vorige maand):</b></td>';
    echo '            <td align="right">';
                      //Berekening datum 1ste tot laatste vorige maand
                      $Start = date("Y/m/") . "1 00:00:00";
                      $Start = DateAdd("m", -1, $Start);
                      $Start = date("Y/m/d", $Start) . ' 00:00:00' ;
                      $Einde = date("Y/m/") . "1 00:00:00";
                      $Einde = DateAdd("d", -1, $Einde);
                      $Einde = date("Y/m/d", $Einde) . ' 23:59:59';

                      func_bw_total_volume_periode($Start, $Einde);
    echo '            </td>';
    echo '        </tr>';
    echo '        <tr>';
    echo '           <td><b>Totaal volume (globaal):</b></td>';
    echo '            <td align="right">';
                      func_bw_total_volume();
    echo '            </td>';
    echo '        </tr>';
    echo '</table></div>';
    echo '<br />';

    //vandaag
    echo '<div><b>Top 10 gebruikers vandaag<b><br />';
    
    echo '<iframe frameborder="0" width="780" height="360" src="graph_bw_total_today_user.php"></iframe>';
    echo '</div>';

    //gisteren

    echo '<div><b>Top 10 gebruikers gisteren<b><br />';
    echo '<iframe frameborder="0" width="780" height="360" src="graph_bw_total_yesterday_user.php"></iframe>';
    echo '</div>';

    //Laatste 7 dagen
    echo '<div><b>Top 10 gebruikers laatste 7 dagen<b><br />';
    echo '<iframe frameborder="0" width="780" height="360" src="graph_bw_total_7days_user.php"></iframe>';
    echo '</div>';

    //Laatste maand
    echo '<div><b>Top 10 gebruikers deze maand<b><br />';
    echo '<iframe frameborder="0" width="780" height="360" src="graph_bw_total_month_user.php"></iframe>';
    echo '</div>';

    //Vorige maand
    echo '<div><b>Top 10 gebruikers vorige maand<b><br />';
    echo '<iframe frameborder="0" width="780" height="360" src="graph_bw_total_prev_month_user.php"></iframe>';
    echo '</div>';


    echo '<div style="width:100%;clear:both;">';
    echo '<br />&nbsp;';
    echo '</div>';
}
if ($_GET['content'] == 3)
{
    //Bandbreedte
    echo '<div>';
    echo '<table>';
    echo '        <tr>';
    echo '            <td><b>Totaal volume (vandaag):</b></td>';
    echo '            <td align="right">';
                    //Berekening datum 1ste tot laatste
                    $Start = date("Y/m/d") . " 00:00:00";
                    $Einde = date("Y/m/d") . " 23:59:59";

                    func_bw_total_volume_periode($Start, $Einde);
    echo '           </td>';
    echo '        </tr>';
    echo '        <tr>';
    echo '            <td><b>Totaal volume (gisteren):</b></td>';
    echo '            <td align="right">';
                    //Berekening datum 1ste tot laatste
                    $Start = date("Y/m/d") . " 00:00:00";
                    $Start = DateAdd("d", -1, $Start);
                    $Start = date("Y/m/d", $Start) . ' 00:00:00' ;
                    $Einde = date("Y/m/d") . " 23:59:59";
                    $Einde = DateAdd("d", -1, $Einde);
                    $Einde = date("Y/m/d", $Einde) . ' 23:59:59' ;

                    func_bw_total_volume_periode($Start, $Einde);
    echo '           </td>';
    echo '        </tr>';
    echo '        <tr>';
    echo '            <td><b>Totaal volume (laatste 7 dagen):</b></td>';
    echo '            <td align="right">';
                    //Berekening datum laatste 7 dagen
                    $Einde = date("Y/m/d") . " 23:59:59";
                    $Start = date("Y/m/d") . " 00:00:00";
                    $Start = DateAdd("d", -6, $Start);
                    $Start = date("Y/m/d", $Start) . ' 00:00:00' ;

                    func_bw_total_volume_periode($Start, $Einde);
    echo '           </td>';
    echo '        </tr>';
    echo '        <tr>';
    echo '            <td><b>Totaal volume (deze maand):</b></td>';
    echo '            <td align="right">';
                    //Berekening datum 1ste tot laatste
                    $Start = date("Y/m/") . "1 00:00:00";
                    $Einde = date("Y/m/") . "1 00:00:00";
                    $Einde = DateAdd("m", 1, $Einde);
                    $Einde = date("Y/m/d", $Einde) . ' 23:59:59' ;
                    $Einde = DateAdd("d", -1, $Einde);
                    $Einde = date("Y/m/d", $Einde) . ' 23:59:59';

                    func_bw_total_volume_periode($Start, $Einde);

    echo '           </td>';
    echo '        </tr>';
    echo '        <tr>';
    echo '            <td><b>Totaal volume (vorige maand):</b></td>';
    echo '            <td align="right">';
                      //Berekening datum 1ste tot laatste vorige maand
                      $Start = date("Y/m/") . "1 00:00:00";
                      $Start = DateAdd("m", -1, $Start);
                      $Start = date("Y/m/d", $Start) . ' 00:00:00' ;
                      $Einde = date("Y/m/") . "1 00:00:00";
                      $Einde = DateAdd("d", -1, $Einde);
                      $Einde = date("Y/m/d", $Einde) . ' 23:59:59';

                      func_bw_total_volume_periode($Start, $Einde);
    echo '            </td>';
    echo '        </tr>';
    echo '        <tr>';
    echo '           <td><b>Totaal volume (globaal):</b></td>';
    echo '            <td align="right">';
                      func_bw_total_volume();
    echo '            </td>';
    echo '        </tr>';
    echo '</table></div>';
    echo '<br />';

    //vandaag
    echo '<div><b>Top 10 authenticators vandaag<b><br />';

    echo '<iframe frameborder="0" width="780" height="360" src="graph_bw_total_today_ident.php"></iframe>';
    echo '</div>';

    //gisteren

    echo '<div><b>Top 10 authenticators gisteren<b><br />';
    echo '<iframe frameborder="0" width="780" height="360" src="graph_bw_total_yesterday_ident.php"></iframe>';
    echo '</div>';

    //Laatste 7 dagen
    echo '<div><b>Top 10 authenticators laatste 7 dagen<b><br />';
    echo '<iframe frameborder="0" width="780" height="360" src="graph_bw_total_7days_ident.php"></iframe>';
    echo '</div>';

    //Laatste maand
    echo '<div><b>Top 10 authenticators deze maand<b><br />';
    echo '<iframe frameborder="0" width="780" height="360" src="graph_bw_total_month_ident.php"></iframe>';
    echo '</div>';

    //Vorige maand
    echo '<div><b>Top 10 authenticators vorige maand<b><br />';
    echo '<iframe frameborder="0" width="780" height="360" src="graph_bw_total_prev_month_ident.php"></iframe>';
    echo '</div>';


    echo '<div style="width:100%;clear:both;">';
    echo '<br />&nbsp;';
    echo '</div>';
}
if ($_GET['content'] == 4)
{
//Bandbreedte
    echo '<div>';
    echo '<table>';
    echo '        <tr>';
    echo '            <td><b>Totaal volume (vandaag):</b></td>';
    echo '            <td align="right">';
                    //Berekening datum 1ste tot laatste
                    $Start = date("Y/m/d") . " 00:00:00";
                    $Einde = date("Y/m/d") . " 23:59:59";

                    func_bw_total_volume_periode($Start, $Einde);
    echo '           </td>';
    echo '        </tr>';
    echo '        <tr>';
    echo '            <td><b>Totaal volume (gisteren):</b></td>';
    echo '            <td align="right">';
                    //Berekening datum 1ste tot laatste
                    $Start = date("Y/m/d") . " 00:00:00";
                    $Start = DateAdd("d", -1, $Start);
                    $Start = date("Y/m/d", $Start) . ' 00:00:00' ;
                    $Einde = date("Y/m/d") . " 23:59:59";
                    $Einde = DateAdd("d", -1, $Einde);
                    $Einde = date("Y/m/d", $Einde) . ' 23:59:59' ;

                    func_bw_total_volume_periode($Start, $Einde);
    echo '           </td>';
    echo '        </tr>';
    echo '        <tr>';
    echo '            <td><b>Totaal volume (laatste 7 dagen):</b></td>';
    echo '            <td align="right">';
                    //Berekening datum laatste 7 dagen
                    $Einde = date("Y/m/d") . " 23:59:59";
                    $Start = date("Y/m/d") . " 00:00:00";
                    $Start = DateAdd("d", -6, $Start);
                    $Start = date("Y/m/d", $Start) . ' 00:00:00' ;

                    func_bw_total_volume_periode($Start, $Einde);
    echo '           </td>';
    echo '        </tr>';
    echo '        <tr>';
    echo '            <td><b>Totaal volume (deze maand):</b></td>';
    echo '            <td align="right">';
                    //Berekening datum 1ste tot laatste
                    $Start = date("Y/m/") . "1 00:00:00";
                    $Einde = date("Y/m/") . "1 00:00:00";
                    $Einde = DateAdd("m", 1, $Einde);
                    $Einde = date("Y/m/d", $Einde) . ' 23:59:59' ;
                    $Einde = DateAdd("d", -1, $Einde);
                    $Einde = date("Y/m/d", $Einde) . ' 23:59:59';

                    func_bw_total_volume_periode($Start, $Einde);

    echo '           </td>';
    echo '        </tr>';
    echo '        <tr>';
    echo '            <td><b>Totaal volume (vorige maand):</b></td>';
    echo '            <td align="right">';
                      //Berekening datum 1ste tot laatste vorige maand
                      $Start = date("Y/m/") . "1 00:00:00";
                      $Start = DateAdd("m", -1, $Start);
                      $Start = date("Y/m/d", $Start) . ' 00:00:00' ;
                      $Einde = date("Y/m/") . "1 00:00:00";
                      $Einde = DateAdd("d", -1, $Einde);
                      $Einde = date("Y/m/d", $Einde) . ' 23:59:59';

                      func_bw_total_volume_periode($Start, $Einde);
    echo '            </td>';
    echo '        </tr>';
    echo '        <tr>';
    echo '           <td><b>Totaal volume (globaal):</b></td>';
    echo '            <td align="right">';
                      func_bw_total_volume();
    echo '            </td>';
    echo '        </tr>';
    echo '</table></div>';
    echo '<br />';

    //vandaag
    echo '<div><b>Top 10 domeinen vandaag<b><br />';

    echo '<iframe frameborder="0" width="780" height="360" src="graph_bw_total_today_domain.php"></iframe>';
    echo '</div>';

    //gisteren

    echo '<div><b>Top 10 domeinen gisteren<b><br />';
    echo '<iframe frameborder="0" width="780" height="360" src="graph_bw_total_yesterday_domain.php"></iframe>';
    echo '</div>';

    //Laatste 7 dagen
    echo '<div><b>Top 10 domeinen laatste 7 dagen<b><br />';
    echo '<iframe frameborder="0" width="780" height="360" src="graph_bw_total_7days_domain.php"></iframe>';
    echo '</div>';

    //Laatste maand
    echo '<div><b>Top 10 domeinen deze maand<b><br />';
    echo '<iframe frameborder="0" width="780" height="360" src="graph_bw_total_month_domain.php"></iframe>';
    echo '</div>';

    //Vorige maand
    echo '<div><b>Top 10 domeinen vorige maand<b><br />';
    echo '<iframe frameborder="0" width="780" height="360" src="graph_bw_total_prev_month_domain.php"></iframe>';
    echo '</div>';


    echo '<div style="width:100%;clear:both;">';
    echo '<br />&nbsp;';
    echo '</div>';
}
?>
